<!--
 * @FileDescription: hr搜索后查看某人详细信息表单
 * @Author: 叶永鸿、袁年政
 * @Date: 2021-7-17
 * @LastEditors: 叶永鸿
 * @LastEditTime: 2021-7-18
 -->
<template>
  <div>
    <el-page-header
      type="info"
      title="返回"
      icon="el-icon-arrow-left"
      @click="retrunSearch"
    >
    </el-page-header>
    <el-space direction="vertical">
      <el-card class="box-card" style="width: 1000px">
        <template #header>
          <span>基本信息</span>
        </template>
        <div>
          <el-descriptions class="margin-top" :column="3" border>
            <el-descriptions-item>
              <template #label>
                <i class="el-icon-user"></i>
                姓名
              </template>
              {{ hrSearchedInfor.realname }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <i class="el-icon-mobile-phone"></i>
                性别
              </template>
              {{ hrSearchedInfor.gender }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <i class="el-icon-mobile-phone"></i>
                手机号
              </template>
              {{ hrSearchedInfor.telephone }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <i class="el-icon-tickets"></i>
                当前公司名
              </template>
              {{ hrSearchedInfor.companyName }}
            </el-descriptions-item>
          </el-descriptions>
          <el-divider></el-divider>
          <el-table
            height="200"
            border
            style="width: 100%"
            :data="searchedInforDetail"
          >
            <el-table-column type="expand">
              <template #default="props">
                <el-form label-position="left" inline class="demo-table-expand">
                  <el-form-item label="评价">
                    <span>{{ props.row.evaluation }}</span>
                  </el-form-item>
                </el-form>
              </template>
            </el-table-column>
            <el-table-column prop="companyname" label="公司名" width="230">
            </el-table-column>
            <el-table-column prop="recruited" label="入职时间" width="170">
            </el-table-column>
            <el-table-column prop="suspended" label="离职时间" width="170">
            </el-table-column>
            <el-table-column prop="position" label="职位" width="220">
            </el-table-column>
            <el-table-column prop="salary" label="年薪(万)" width="120">
            </el-table-column>
          </el-table>
        </div>
      </el-card>
    </el-space>
  </div>
</template>


<script lang="ts">
import {
  //provide,
  ref,
  getCurrentInstance,
  computed,
  reactive,
  toRefs,
} from "vue";

import axios from "axios";
import router from "@/router";

import { useStore } from "vuex";
import store, { LoginState } from "@/store";

export default {
  name: "searchPublicInfor",
  props: ["tel"],

  setup() {
    // @ts-ignore
    const { proxy } = getCurrentInstance();

    const store = useStore<LoginState>();
    const loginInfor = computed(() => store.state.loginInfor);
    const hrSearched = computed(() => store.state.hrSearched);
    const getHrSearchInfor = computed(() => store.getters.getUser_hrSearch);
    const getLoginInfor = computed(() => store.getters.getUserInfor);

    const searchInformation = reactive({
      searchedInforDetail: store.getters.getUser_hrSearch.hrSearchedInforDetail,
      hrSearchedInfor: store.getters.getUser_hrSearch.hrSearchedInfor,
    });

    const print = () => {
      console.log(proxy.searchedInforDetail);
      console.log(proxy.hrSearchedInfor);
    };

    const retrunSearch = () => {
      router.go(-1);
    };

    const checkDescription = (row: number) => {};

    return {
      ...toRefs(searchInformation),
      hrSearched,
      getHrSearchInfor,
      print,
      retrunSearch,
      checkDescription,
      loginInfor,
      getLoginInfor,
    };
  },
};
</script>

<style >
</style>
